import { defineStore } from "pinia";

const userNavAction = defineStore("userNavAction",{
    state:()=>{
        return {
            fixedHeader:true,//头部信息定位
            fixedCategory:true,//分类信息定位
            showHeader:true,//头部信息
            showCategroy:true,//分类信息
            forceFixedHeader:false,//强制显示固定头部信息
        }
    },
    actions:{
        setFixedHeader(fixedHeader) {
            this.fixedHeader = fixedHeader;
        },
        setFixedCategory(fixedCategory) {
            this.fixedCategory = fixedCategory;
        },
        setShowHeader(showHeader) {
            this.showHeader = showHeader;
        },
        setShowCategory(showCategroy){
            this.showCategroy = showCategroy;
        },
        setForceFixedHeader(forceFixedHeader) {
            this.forceFixedHeader = forceFixedHeader;
        }
    }
}, {
    persist:{
        enabled:true,//开启持久化
        key:'userNavAction',//持久化存储的key
        storage:localStorage,
    }
})
export default userNavAction;